import logging
from sugar.activity import activity
from sugar.graphics.toolbar import Toolbar
from sugar.graphics import units
from comics.layoutToolbar import LayoutBar
from comics.pageCanvas import PageCanvas

import gtk
import hippo
import cairo

class ComicsActivity(activity.Activity):

    def __init__(self, handle):
        activity.Activity.__init__(self, handle)

        self.canvas = hippo.CanvasBox(orientation=hippo.ORIENTATION_VERTICAL,
                            background_color=0xffffffff)
        self.set_root(self.canvas)

        self.toolbar = Toolbar()
        self.canvas.append(self.toolbar, hippo.PACK_END)

        self.layouts = LayoutBar()
        self.canvas.append(self.layouts, hippo.PACK_FLOAT_RIGHT)

        self.pages = PageCanvas()
        self.canvas.append(self.pages, hippo.PACK_CLEAR_LEFT)

        self.set_title("Comics!")

